package com.crazymaker.springcloud.standard.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 负载均衡策略Holder
 *
 * @date 2019/9/2
 */
public class LbIsolationContextHolder
{
    private static final ThreadLocal<String> VERSION_CONTEXT = new TransmittableThreadLocal<>();

    public static void setVersion(String version)
    {
        VERSION_CONTEXT.set(version);
    }

    public static String getVersion()
    {
        return VERSION_CONTEXT.get();
    }

    public static void clear()
    {
        VERSION_CONTEXT.remove();
    }
}
